package com.museum.controller.api;

import com.alibaba.fastjson.JSONObject;
import com.museum.base.BaseResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;


@Api(tags = ("权限-菜单管理"))
public interface PermissionAPI {
    /**
     * 获取全部菜单
     * @return
     */
    @ApiOperation("获取全部菜单")
    @GetMapping("/getAllMenu")
   // @Cacheable(cacheNames = "AllMenu")
    BaseResponse<JSONObject>getAllPermission(HttpServletRequest request);


    /**
     *禁用菜单
     * @param permissionId
     * @return
     */
    @ApiOperation("禁用菜单")
    @PostMapping("closePermission")
    BaseResponse<JSONObject> closePermission(HttpServletRequest request, @RequestParam("permissionId") Integer permissionId);

    /**
     * 打开菜单
     * @param permissionId
     * @return
     */
    @ApiOperation("打开菜单")
    @PostMapping("openPermission")
    BaseResponse<JSONObject> openPermission(HttpServletRequest request,@RequestParam("permissionId") Integer permissionId);

}
